home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
dskut
/
decode10.zip
/
123.RUL
next >
Wrap
Text File
|
1992-12-07
|
19KB
|
1,006 lines
############################################################################
# #
# 123.rul -- Decode It! rule file for Lotus Worksheet files #
# #
# #
# Please note: This rule file is provided as an example only. While #
# every effort has been made to validate the information #
# presented here, Axiom Innovations takes no responsibility #
# for the integrity of the data that results from using #
# this example. #
# #
############################################################################
RECORD RECORD_123
# 123 Record Header
SHORT RecordType
SHORT RecordLength
# Beginning of File
WHILE RECORD_123.RecordType <=> 0
RECORD BeginOfFile
# Id should equal 1028 or 1030
XSHORT Id
WHILE RECORD_123.BeginOfFile.Id <> 1028
BEGIN
WHILE RECORD_123.BeginOfFile.Id <> 1030
EXIT
END
RETURN
END
# End of file
WHILE RECORD_123.RecordType <=> 1
RECORD EndOfFile
# Decode bytes after Lotus EOF
ASCII AfterEOF -1
EXIT
END
# Calculation method
WHILE RECORD_123.RecordType <=> 2
BEGIN
# 0 = manual mode, FF = automatic
XTINY CalcMode
RETURN
END
# Calculation order
WHILE RECORD_123.RecordType <=> 3
BEGIN
# 0 = natural, 1 = by column, FF = by row
XTINY CalcOrder
RETURN
END
# Split window type
WHILE RECORD_123.RecordType <=> 4
BEGIN
# 0 = not split, 1 = vertical split, FF = horizontal split
XTINY SplitType
RETURN
END
# Split window sync
WHILE RECORD_123.RecordType <=> 5
BEGIN
# 0 = not synchronized, FF = synchronized
XTINY SyncType
RETURN
END
# Active worksheet range (start col, start row, end col, end row)
WHILE RECORD_123.RecordType <=> 6
BEGIN
SHORT ActiveRange 4
RETURN
END
# Window 1 and 2
BEGIN
WHILE RECORD_123.RecordType <> 7
BEGIN
WHILE RECORD_123.RecordType <> 9
RESCIND
END
RECORD Window
SHORT CursorPosition 2
#####################################################################
# #
# Each bit of the cell format byte is used as follows: #
# #
# Bit Description Value Meaning #
# --- ----------- ----- ------- #
# 7 protection 1 protected #
# 0 unprotected #
# #
# 4-6 format type 0 fixed #
# 1 scientific notation #
# 2 currency #
# 3 percent #
# 4 comma #
# 5-6 unused #
# 7 ** special ** (see below) #
# #
# 0-3 decimal places 0-15 ** Only if format type = 0-6 ** #
# special format if format type = 7 : #
# 0 +/- #
# 1 general #
# 2 day-month-year #
# 3 day-month #
# 4 month-year #
# 5 text #
# 6 hidden #
# 7 date : hour-min-sec #
# 8 date : hour-min #
# 9 date : international 1 #
# 10 date : international 2 #
# 11 time : international 1 #
# 12 time : international 2 #
# 13-14 not used #
# 15 default #
# #
#####################################################################
XTINY Format
TINY Unused1
SHORT DefaultWidth
SHORT ScreenSize 2
SHORT StartPosition 2
SHORT TitleSize 2
SHORT TitleStart 2
SHORT TopLeftPosition 2
SHORT NumberCols
TINY Unused2 2
RETURN
END RECORD_123.RecordLength
END
# Column width (for window 1)
WHILE RECORD_123.RecordType <=> 8
RECORD ColWidth1
XSHORT Id
XTINY Width
RETURN
END
# Column width (for window 2)
WHILE RECORD_123.RecordType <=> 10
RECORD ColWidth2
XSHORT Id
XTINY Width
RETURN
END
# Named range (start col, start row, end col, end row)
WHILE RECORD_123.RecordType <=> 11
RECORD NamedRange
ASCII Name 16
(OMIT0) RECORD_123.NamedRange.Name
SHORT Range 4
RETURN
END
# Blank Cell
WHILE RECORD_123.RecordType <=> 12
RECORD BlankCell
# Cell Format (see above)
XTINY Format
SHORT Column
SHORT Row
RETURN
END
# Integer number cell
WHILE RECORD_123.RecordType <=> 13
RECORD Integer
# Cell Format (see above)
XTINY Format
SHORT Column
SHORT Row
SHORT Value
RETURN
END
# Floating point number
WHILE RECORD_123.RecordType <=> 14
RECORD Number
# Cell Format (see above)
XTINY Format
SHORT Column
SHORT Row
DFLOAT Value
RETURN
END
# Label cell
WHILE RECORD_123.RecordType <=> 15
RECORD Label
# Cell Format (see above)
XTINY Format
SHORT Column
SHORT Row
# Label format prefix:
# | = printer command, \ = repeating, ' = left alignment,
# " = right alignment, ^ = centered.
ASCII LabelPrefix
ASCII Label -1
RETURN
END RECORD_123.RecordLength
# Formula cell
WHILE RECORD_123.RecordType <=> 16
RECORD Formula
# Cell Format (see above)
XTINY Format
SHORT Column
SHORT Row
DFLOAT Value
SHORT Size
# Formulas are stored in postfix (reverse polish) notation
RECORD Postfix -1
#### The most frequently used operations are indicated ####
XTINY OpCode
WHILE RECORD_123.Formula.Postfix.OpCode <=> 0
DFLOAT Constant
WHILE RECORD_123.Formula.Postfix.OpCode <=> 1
RECORD Variable
# A '1' in bit 15 indicates relative cell reference
# A '0' in bit 15 indicates absolute cell reference
XSHORT Coordinate 2
END
WHILE RECORD_123.Formula.Postfix.OpCode <=> 2
# (start col, start row, end col, end row)
XSHORT Range 4